<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>SuperConstructor: {$pageTitle}</title>
  <link rel="stylesheet" href="common/css/sc.css" />
{foreach from=$extraStyles item=href}
  <link rel="stylesheet" href="{$href}" />
{/foreach}
  <script language="javascript" src="common/js/prototype.js"></script>
{foreach from=$extraScripts item=href}
  <script language="javascript" src="{$href}"></script>
{/foreach}
</head>

<body>

  <div id="HEAD">
    <div id="BTOP">&nbsp;</div>
    <div id="HBAN"><h1>SuperConstructor</h1></div>
    
    <div id="HSET">
      {if isset($_user)}<span id="USER">Welcome back, {$_user->name} (<a href="{#AdminRoot#}{#LogoutPage#}">Log Out</a>)</span>{/if}
      <ul class="NAV">
        <li><a href="{#AdminRoot#}">Main</a></li>
        <li>{if isset($_user)}<a href="{#AdminRoot#}{#SettingsPage#}">My Settings</a>{/if}</li>
      </ul>
	  <div id="KNIFE"></div>
    </div>
    {if isset($_user)}
    {if $_user->IsAdmin()}
    <div id="HADM">
      <ul class="NAV">
        <li><a href="{#AdminRoot#}{#SetupPage#}">Setup</a></li>
        <li><a href="{#AdminRoot#}{#UserAdminPage#}">Users</a></li>
        <li><a href="{#AdminRoot#}{#TableMainPage#}">Tables</a></li>
        <li><a href="{#AdminRoot#}{#BindingsPage#}">Bindings</a></li>
      </ul>
    </div>
    {/if}
    <div id="HSEC">
      <ul class="NAV">
      {foreach from=$_bindings item=b key=id}
        <li><a href="{#AdminRoot#}{#CRUDPage#}?i={$id}">{$b}</a></li>
      {/foreach}
      </ul>
    </div>
    {/if}
  </div>
  
  <div id="CTNT">